package bishihuizong;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by JiaJia on 2019/9/16 0016.
 */
public class Kuaishou02 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String number=scanner.nextLine();
            List<String> result=letterCombinations(number);
            /*StringBuilder sb=new StringBuilder();
            sb.append("[");
            for (String s:result){
                sb.append(s).append(",");
            }
            sb.deleteCharAt(sb.length()-1);
            sb.append("]");
            System.out.println(sb.toString());*/
            System.out.println(result);
        }scanner.close();
    }
    private static final String[] keys={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
    public static List<String> letterCombinations(String digits){
        List<String> combinations=new ArrayList<>();
        if (digits==null||digits.length()==0){
            return combinations;
        }
        findCombination(new StringBuilder(),combinations,digits);
        return combinations;
    }
    private static void findCombination(StringBuilder prefix,List<String> combinations,String digits){
        if (prefix.length()==digits.length()){
            combinations.add(prefix.toString());
            return;
        }
        int cur=digits.charAt(prefix.length())-'0';
        String letters=keys[cur];
        for(char c:letters.toCharArray()){
            prefix.append(c);
            findCombination(prefix,combinations,digits);
            prefix.deleteCharAt(prefix.length()-1);
        }
    }
}